var _account_service = require('service/account-service.js');

console.log('header')

var header = {
  init : function(){
    this.bindEvents();
    this.login()
    // this.loadAccountInfo();
    return this;
  },

  bindEvents: function(){

  },

  loadAccountInfo: function(){
    console.log('loadAccountInfo')
    _account_service.checkLogin(
      function(res){
        console.log('success')
      },
      //未登录
      function(errMsg){
        console.log('error')
      }
    )
  },

  login: function(){
    var account = {
      username: 'aaa',
      password: '123'
    }
    _account_service.login(
      account,
      function(res){
        console.log('success');
        console.log(res);
      },
      //未登录
      function(errMsg){
        console.log('error')
      }
    )
  }

}

module.exports = header.init()